package cc.ailley.factory.simple;

import cc.ailley.factory.Mengniu;
import cc.ailley.factory.Milk;
import cc.ailley.factory.Telunsu;
import cc.ailley.factory.Yili;

/**
 * 简单工厂模式(好比小作坊)
 *
 * @author ailley
 */
public class SimpleMilkFactory {

    public Milk getMilk(String name){
        if("特仑苏".equals(name)){
            return new Telunsu();
        }else if("蒙牛".equals(name)){
            return new Mengniu();
        }else if ("伊犁".equals(name)){
            return new Yili();
        }
        return null;
    }
}
